package com.his.util.util;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.his.util.result.RestResult;
import com.his.util.result.RestResultBuilder;

public class MapperUtil {
    public static final RestResult save(ServiceImpl service, Object obj) {
        if (service.save(obj)) {
            return new RestResultBuilder().success();
        }

        return new RestResultBuilder().fail();
    }

    public static final RestResult update(ServiceImpl service, Object obj) {
        if (service.updateById(obj)) {
            return new RestResultBuilder().success();
        }

        return new RestResultBuilder().fail();
    }
}
